/* ==========================================================================
   3D WEDDING PHOTO GALLERY ENGINE - STYLESHEET (Clean White Theme)
   High-Performance, Mobile-Optimized, CSS 3D Transforms & Clean Aesthetics
   ========================================================================== */

:root {
  --w3d-bg-primary: #ffffff;
  --w3d-bg-secondary: #f9f8f4;
  --w3d-gold-primary: #c89b3c;
  --w3d-gold-light: #e5c158;
  --w3d-gold-dark: #8c6819;
  --w3d-card-border: rgba(200, 155, 60, 0.35);
  --w3d-glass-bg: #ffffff;
  --w3d-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(200, 155, 60, 0.2);
  --w3d-font-family: 'Cinzel', 'Playfair Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base Wrapper */
.wedding-3d-gallery-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 520px;
  min-height: 400px;
  margin-top: 0;
  background: transparent;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  font-family: var(--w3d-font-family);
  box-sizing: border-box;
}

/* Ambient Sparkle Canvas */
.w3d-sparkle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* 3D Viewport & Stage (VERTICALLY CENTERED WITH ENHANCED 3D PERSPECTIVE) */
.w3d-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 750px;
  perspective-origin: 50% 50%;
  z-index: 2;
  overflow: hidden;
}

.w3d-stage {
  position: relative;
  width: 195px;
  height: 320px;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Card Styling */
.w3d-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 18px;
  background-color: var(--w3d-glass-bg);
  border: 1px solid var(--w3d-card-border);
  box-shadow: var(--w3d-shadow);
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform, opacity, filter;
  cursor: pointer;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, filter 0.3s ease;
  overflow: hidden;
}

.w3d-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 17px;
  overflow: hidden;
  display: flex;
}

.w3d-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Active Center Card Highlight */
.w3d-card.w3d-active {
  border-color: var(--w3d-gold-primary);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18), 0 0 25px rgba(200, 155, 60, 0.35);
}

.w3d-card.w3d-active .w3d-card-img {
  transform: scale(1.03);
}

/* Interactive Minimal Controls Bar (REMOVED AS PER CLIENT REQUEST) */
.w3d-controls {
  display: none !important;
}

.w3d-btn {
  background: transparent;
  border: none;
  color: #333333;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.w3d-btn:hover, .w3d-btn:focus-visible {
  background: rgba(200, 155, 60, 0.18);
  color: var(--w3d-gold-dark);
  transform: scale(1.08);
  outline: none;
}

.w3d-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Quick Jump Dots */
.w3d-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

.w3d-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: all 0.3s ease;
}

.w3d-dot.w3d-dot-active {
  width: 22px;
  border-radius: 10px;
  background: var(--w3d-gold-primary);
  box-shadow: 0 0 8px rgba(200, 155, 60, 0.5);
}

/* Lightbox Fullscreen Modal */
.w3d-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(14, 6, 10, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  touch-action: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transform: none !important;
}

.w3d-lightbox.w3d-open {
  opacity: 1;
  pointer-events: auto;
}

.w3d-lightbox-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 1000000;
  pointer-events: none;
}

.w3d-lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 253, 249, 0.96);
  border: 1.5px solid var(--w3d-gold-primary);
  color: #8B1E2D;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000001;
  pointer-events: auto;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, background 0.2s ease;
}

.w3d-lightbox-close:hover {
  background: #ffffff;
  transform: scale(1.1);
  color: #58111A;
}

.w3d-lightbox-close svg {
  width: 22px;
  height: 22px;
  stroke: #8B1E2D;
  stroke-width: 2.5;
}

.w3d-lightbox-body {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
  box-sizing: border-box;
  margin: 0 auto;
}

.w3d-lightbox-img-wrapper {
  max-width: 84vw;
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: auto;
}

.w3d-lightbox-img {
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  border: 1.5px solid rgba(212, 175, 55, 0.7);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 35px rgba(200, 155, 60, 0.35);
  display: block;
  margin: auto;
}

.w3d-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 253, 249, 0.9);
  border: 1.5px solid rgba(200, 155, 60, 0.7);
  color: #8B1E2D;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 1000000;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.w3d-lightbox-nav:hover {
  background: var(--w3d-gold-primary);
  color: #fff;
  transform: translateY(-50%) scale(1.1);
}

.w3d-lightbox-nav.w3d-prev { left: 20px; }
.w3d-lightbox-nav.w3d-next { right: 20px; }

/* Mobile Screen Responsiveness (< 768px) */
@media (max-width: 768px) {
  .wedding-3d-gallery-wrapper {
    height: 460px;
  }
  
  .w3d-viewport {
    perspective: 620px;
  }
  
  .w3d-stage {
    width: 160px;
    height: 260px;
  }

  .w3d-controls {
    bottom: 16px;
    padding: 6px 12px;
    gap: 8px;
  }

  .w3d-btn {
    width: 32px;
    height: 32px;
  }

  .w3d-lightbox-nav.w3d-prev { left: 10px; }
  .w3d-lightbox-nav.w3d-next { right: 10px; }
}

@media (max-width: 480px) {
  .wedding-3d-gallery-wrapper {
    height: 420px;
  }
  
  .w3d-viewport {
    perspective: 500px;
  }
  
  .w3d-stage {
    width: 135px;
    height: 220px;
  }
}
